//
//  FDMSearchCollectionReusableView.m
//  Entertainment
//
//  Created by dllo on 16/4/26.
//  Copyright © 2016年 付冬梅. All rights reserved.
//

#import "FDMSearchCollectionReusableView.h"

@implementation FDMSearchCollectionReusableView

- (instancetype)initWithFrame:(CGRect)frame {
    self = [super initWithFrame:frame];
    if (self) {
        self.brownView = [[UIView alloc] initWithFrame:CGRectMake(0, 10, 2, 20)];
        [self addSubview:self.brownView];
        [self.brownView release];
        self.brownView.backgroundColor = [UIColor colorWithRed:1.00 green:0.36 blue:0.14 alpha:1.00];
        self.titleLabel = [[FDMBaseLabel alloc] initWithFrame:CGRectMake(10, 10, 150, 20)];
        [self addSubview:self.titleLabel];
        [self.titleLabel release];
        self.cleanButton = [FDMBaseButton buttonWithType:UIButtonTypeCustom];
        [self addSubview:self.cleanButton];
        [self.cleanButton setTitle:@"清除历史" forState:UIControlStateNormal];
        [self.cleanButton setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
        self.cleanButton.frame = CGRectMake(self.frame.size.width - 80, 10, 80, 20);
        [self.cleanButton addTarget:self action:@selector(cleanButtonAction:) forControlEvents:UIControlEventTouchUpInside];
    }
    return self;
}

- (void)cleanButtonAction:(FDMBaseButton *)cleanButton {
    [self.cleanDelegate clickCleanButton];
}

- (void)dealloc {
    [self.brownView release];
    [self.titleLabel release];
    [self.cleanButton release];
    [super dealloc];
    
}

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
